package com.endlessblue.visa.vo;

/**
 * 
 * 业务系统返回码定义
 * @author sonta
 */
public enum BusiCode {

	
	ERROR_0000("0000","成功"),
	ERROR_9001("9001","未登陆"),
	ERROR_9002("9002","无权限"),
	ERROR_9003("9003","用户名或密码错误"),
	ERROR_9004("9004","用户不存在"),
	ERROR_9005("9005","参数错误（格式错误/必填项为空等见具体返回）"),
	ERROR_9006("9006","验证码错误"),
	ERROR_9007("9007","用户已在其它地点登录"),
	ERROR_9008("9008","该APP版本无法使用"),
	ERROR_9009("9009","用户名已被注册"),
	ERROR_9010("9010","验证码发送失败"),
	ERROR_9011("9011","验证码错误"),
	ERROR_9901("9901","未调用初始化接口"),
	ERROR_9998("9998","非法操作"),
	ERROR_9999("9999","系统内部错误");
	
	@Override
	public String toString() {
		return code;
	}

	private BusiCode(String code, String msg) {
		this.code = code;
		this.msg = msg;
		
	}
	/** 状态码  **/
	private String code;

	/** 状态描述  **/
	private String msg;
	
	

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}


	public static BusiCode getCode(String code) {
		for (BusiCode c : BusiCode.values()) {
			if (c.getCode().equals(code)) {
				return c;
			}
		}
		return null;
	}
}